﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Mail;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ProjectRadar.WebApp
{
    public partial class TestEmail : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void SendEmailButton_Click(object sender, EventArgs e)
        {
            
            MailMessage mailMessage = new MailMessage();
            mailMessage.From = new MailAddress("structureware@vsysad.com");
            mailMessage.To.Add("zhixian@aporigin.com");
            mailMessage.Subject = "Hello workd";

            mailMessage.Body = "<b>Sender Name : </b>" + "zhixian" + DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss") + "<br/>"
                 + "<b>Sender Email : </b>" + "my text here" + "<br/>"
                 + "<b>Comments : </b>" + "my comments here";
            mailMessage.IsBodyHtml = true;

            //SmtpClient smtpClient = new SmtpClient("localhost", 25);
            SmtpClient smtpClient = new SmtpClient();
            smtpClient.Send(mailMessage);
        }
    }
}
